package com.kuangstudy.test;

import java.util.ArrayList;

/**
 * @author Losca
 * @date 2022/3/23 12:49
 */
public class Demo6 {
    public static void main(String[] args) {
        //Integer a = 128;
        //Integer b = 128;
        //System.out.println(a == b);//false
        //System.out.println(a.intValue() == b.intValue());//true
        String a = "a";
        String b = "b";
        //开辟了StringBuilder对象
        String c = a + b;
        // 默认为"ab"
        String d = "a" + "b";
        StringBuilder builder = new StringBuilder("a");
        StringBuffer buffer = new StringBuffer("a");
        System.out.println(c == d);//false
        System.out.println(builder.equals(buffer));//false 对象类型不一样，不相等
        ArrayList<Object> objects = new ArrayList<>();
        objects.add("1");
    }
}
